package com.zhicheng.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class Order {

    /**
     * 订单状态 1待付款 2待发货 3待收货 4待评价 5已完成 6已取消
     */
    public static final Integer PENDING_PAYMENT = 1;
    public static final Integer PENDING_SHIPMENT = 2;
    public static final Integer AWAITING_DELIVERY= 3;
    public static final Integer PENDING_EVALUATION = 4;
    public static final Integer COMPLETED = 5;
    public static final Integer CANCELLED = 6;

    /**
     * 支付状态 0未支付 1已支付 2退款
     */
    public static final Integer UN_PAID = 0;
    public static final Integer PAID = 1;
    public static final Integer REFUND = 2;

    //订单号
    private String id;
    //订单状态 1待付款 2待发货 3待收货 4待评价 5已完成 6已取消
    private Integer orderStatus;
    //订单商品id集合
    private String goodsId;
    //下单用户id
    private Long userId;
    //下单用户名称
    private String userName;
    //地址id
    private Long addressBookId;
    //收货人
    private String consignee;
    //手机号
    private String phone;
    //详细地址
    private String address;
    //下单时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderTime;
    //支付时间
    private String checkoutTime;
    //支付渠道 1支付宝 2其他
    private Integer payChannel;
    //支付方式 1为在线支付, 2为货到付款
    private Integer payType;
    //支付状态 0未支付 1已支付 2退款
    private Integer payStatus;
    //订单数量合计
    private Integer totalNum;
    //订单金额
    private BigDecimal totalPrice;
    //实付金额
    private BigDecimal payAmount;
    //订单邮费
    private BigDecimal postFee;
    //配送时间类型，1为不限，2为工作日，3为双休或假日
    private Integer deliveryTimeType;
    //订单付款截止时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payLatestTime;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
